<template>
	<div class="wrapper">
		<swiper :options="swiperOption" v-if="showSwiiper">
    <!-- slides -->    	
		    <swiper-slide v-for="item of list" :key="item.id">
		    	<img class="swiper-img" :src="item.imgUrl" />
		    </swiper-slide>
		    <!-- <swiper-slide>
		    	<img class="swiper-img" src="../../../assets/img/swiper1.jpg" />
		    </swiper-slide> -->
		    <div class="swiper-pagination"  slot="pagination"></div>		    
  	</swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props:{
    list:Array
  },
  data (){
  	return{
  		swiperOption:{
  			pagination:'.swiper-pagination',
        autoplay:2000,
  			loop:true
  		},
  		// swiperList:[{
  		// 	id:'0001',
  		// 	imgUrl:require('../../../assets/img/swiper1.jpg')
  		// },{
  		// 	id:'0002',
  		// 	imgUrl:require('../../../assets/img/swiper2.jpg')
  		// },{
  		// 	id:'0003',
  		// 	imgUrl:require('../../../assets/img/swiper3.jpg')
  		// },{
  		// 	id:'0004',
  		// 	imgUrl:require('../../../assets/img/swiper4.jpg')
  		// }]
  	}
  },
  computed:{
    showSwiiper (){
      return this.list.length;
    }
  }
}	
</script>

<style scoped>
	.wrapper >>> .swiper-pagination-bullet-active{
		background-color: #fff;
	}
	.wrapper{
		width: 100%;
		/*height: 0;*/
		overflow: hidden;
		/*padding-bottom: 31.25%;*/
	}
	.swiper-img{
		width: 100%;
	}
	
</style>